<h2 {% ifequal competition_view_type "all" %}style="margin-bottom: 0.4em;"{% endifequal %}>
{% ifequal competition_view_type "monthly" %}
    {{ first_day|date:"F Y"|capfirst }}
{% else %}
    {% ifequal competition_view_type "yearly" %}
    {{first_day|date:"Y"}}
    {% else %}
    Všechny závody
    {% endifequal %}
{% endifequal %}
:: Přehled závodů</h2>

{% ifequal competition_view_type "monthly" %}
<ul class="pager_menu">
    <li class="previous"><a href="{% url athletelog.views.competition.monthly_view athlete_id=athlete.person.user.username,year=previous_year,month=previous_month %}">Předchozí měsíc</a></li>
    <li class="next"><a href="{% url athletelog.views.competition.monthly_view athlete_id=athlete.person.user.username,year=next_year,month=next_month %}">Další měsíc</a></li>
</ul>
{% else %}
{% ifequal competition_view_type "yearly" %}
<ul class="pager_menu">
    <li class="previous"><a href="{% url athletelog.views.competition.yearly_view athlete_id=athlete.person.user.username,year=previous_year %}">Předchozí rok</a></li>
    <li class="next"><a href="{% url athletelog.views.competition.yearly_view athlete_id=athlete.person.user.username,year=next_year %}">Další rok</a></li>
</ul>
{% endifequal %}
{% endifequal %}

{% if competitions %}

<div class="table_header_bg corner_tl"><div class="corner_tr">

<table cellspacing="0">
    <thead>
        <tr>
            <th class="date">Datum</th>
            <th class="event">Disciplína</th>
            <th class="result">Výkon</th>
            <th class="place">Místo</th>
            <th scope="col">&nbsp;</th>
            <th scope="col">&nbsp;</th>
        </tr>
     </thead>
     <tbody>
        {% for c in competitions %}
        <tr>
            <th scope="row">{{ c.day|date:"j.n.Y" }}</th>
            <td>
            {% if c.event.has_additional_info %}
            {{c.event_info}}
            {% else %}
            {{c.event.name}}
            {% endif %}
            </td>
            <td>{{ c.result }}</td>
            <td>{{ c.place }}</td>
            <td>
                <a href="{% url athletelog.views.competition.edit_form athlete_id=athlete.person.user.username,year=c.day.year,month=c.day.month,day=c.day.day,competition_id=c.id %}" class="edit_competition" 
                id="edit_competition_{{ c.day|date:"Y-m-d" }}_{{ c.id }}" title="Upravit závod">
                <span>Upravit závod</span></a>
            </td>
            <td>
                <a href="{% url athletelog.views.competition.remove_competition athlete_id=athlete.person.user.username,competition_id=c.id %}" class="remove_competition" 
                    id="remove_competition_{{ c.day|date:"Y-m-d" }}_{{ c.id }}" title="Odstranit závod">
                    <span>Odstranit závod</span></a>
            </td>
        </tr>
        {% endfor %}
     </tbody>
</table>

</div></div>
{% else %}
<div class="info_box information">
<p class="content">Žádné závody</p>
</div>
{% endif %}

{% ifequal competition_view_type "monthly" %}
<ul class="pager_menu">
    <li class="previous"><a href="{% url athletelog.views.competition.monthly_view athlete_id=athlete.person.user.username,year=previous_year,month=previous_month %}">Předchozí měsíc</a></li>
    <li class="next"><a href="{% url athletelog.views.competition.monthly_view athlete_id=athlete.person.user.username,year=next_year,month=next_month %}">Další měsíc</a></li>
</ul>
{% else %}
{% ifequal competition_view_type "yearly" %}
<ul class="pager_menu">
    <li class="previous"><a href="{% url athletelog.views.competition.yearly_view athlete_id=athlete.person.user.username,year=previous_year %}">Předchozí rok</a></li>
    <li class="next"><a href="{% url athletelog.views.competition.yearly_view athlete_id=athlete.person.user.username,year=next_year %}">Další rok</a></li>
</ul>
{% endifequal %}
{% endifequal %}
